package com.example.demo11.dem3;

/**
 * @program: demo11
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-10-31 20:37
 **/
public class Tick implements Runnable {
    private int tickets=100;
    @Override
    public void run(){
        while (true){
            if (tickets>0){
                System.out.println(Thread.currentThread().getName()+"卖了一张票,剩余:"+ --tickets);
            }else {
                break;
            }
        }
    }
}
